package com.seed.auth.service.impl;

import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seed.auth.dao.UserDao;
import com.seed.auth.dao.UserPermissionDao;
import com.seed.auth.dao.UserRoleDao;
import com.seed.auth.entity.TAuthPermission;
import com.seed.auth.entity.TAuthRole;
import com.seed.auth.entity.TAuthUser;
import com.seed.auth.service.UserService;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;
    @Autowired
    private UserRoleDao userRoleDao;
    @Autowired
    private UserPermissionDao userPermissionDao;
    
    @Override
    public TAuthUser findByUsername(String username) {
        
        return userDao.findByUsername(username);
    }

    @Override
    public Set<TAuthRole> findRoles(String username) {
        
        return userRoleDao.findByUsername(username);
    }

    @Override
    public Set<TAuthPermission> findPermissions(String username) {
        
        return userPermissionDao.findByUsername(username);
    }


}
